]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellUserVerifier: fix fail counter
authorGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 29 Oct 2012 16:40:55 +0000 (17:40 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 29 Oct 2012 16:54:12 +0000 (17:54 +0100)
If it is updated after checking, it counts the number of failures
not including the current one, so it allows one extra attempt. Instead,
by updating it before checking, we get the expected result of dropping the
curtain at the third password.

https://bugzilla.gnome.org/show_bug.cgi?id=687132

js/gdm/util.js

index da31daab8d6826e1141148eaeaca17be72b88221..d71e55f6eff2807e13d155e5258f624b1f279cc5 100644 (file)
@@ -333,12 +333,11 @@ const ShellUserVerifier = new Lang.Class({
         // Otherwise, we allow ALLOWED_FAILURES attempts. After that, we
         // go back to the welcome screen.
 
+        this._failCounter++;
         let canRetry = retry && this._userName &&
             this._failCounter < this._settings.get_int(ALLOWED_FAILURES_KEY);
 
         if (canRetry) {
-            this._failCounter++;
-
             this.clear();
             this.begin(this._userName, new Batch.Hold());
         } else {